Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:57:54) [MSC v.1924 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> -- 创建油罐温度数据表
CREATE TABLE OilTankTemperatureData (
    RecordID INT AUTO_INCREMENT PRIMARY KEY,
    Timestamp TIMESTAMP,
    TankName VARCHAR(30),
    Temperature FLOAT,
    TemperatureUnit VARCHAR(10),
    MaxTemperature FLOAT,
    MinTemperature FLOAT,
    AlarmLevel INT,
    SensorID VARCHAR(20),
    PLCChannel INT,
    Location VARCHAR(50),
    TankMaterial VARCHAR(20),
    OilType VARCHAR(30),
    MaintenanceDate DATE,
    LastCalibrationDate DATE,
    TemperatureTrend VARCHAR(20),
    AmbientTemperature FLOAT,
    HeatingStatus INT,
    CoolingStatus INT,
    DataSource VARCHAR(30)
);

-- 插入示例数据
INSERT INTO OilTankTemperatureData (Timestamp, TankName, Temperature, TemperatureUnit, MaxTemperature, MinTemperature, AlarmLevel, SensorID, PLCChannel, Location, TankMaterial, OilType, MaintenanceDate, LastCalibrationDate, TemperatureTrend, AmbientTemperature, HeatingStatus, CoolingStatus, DataSource)
VALUES
-- 数据记录1
('2024-11-01 12:00:00', 'TankA', 28.5, 'Celsius', 30.0, 25.0, 0, 'Sensor_101', 1, 'Warehouse_1', 'Steel', 'Crude Oil', '2024-09-15', '2024-08-01', 'Stable', 25.0, 0, 0, 'PLC_1'),
-- 数据记录2
('2024-11-01 12:15:00', 'TankA', 28.8, 'Celsius', 30.0, 25.0, 0, 'Sensor_101', 1, 'Warehouse_1', 'Steel', 'Crude Oil', '2024-09-15', '2024-08-01', 'Rising Slowly', 25.2, 0, 0, 'PLC_1'),
-- 数据记录3
('2024-11-01 12:30:00', 'TankA', 29.0, 'Celsius', 30.0, 25.0, 0, 'Sensor_101', 1, 'Warehouse_1', 'Steel', 'Crude Oil', '2024-09-15', '2024-08-01', 'Rising Slowly', 25.3, 0, 0, 'PLC_1'),
-- 数据记录4
('2024-11-01 12:45:00', 'TankB', 32.0, 'Celsius', 35.0, 30.0, 0, 'Sensor_201', 2, 'Warehouse_2', 'Carbon Steel', 'Diesel', '2024-10-01', '2024-09-01', 'Stable', 28.0, 0, 0, 'PLC_2'),
-- 数据记录5
('2024-11-01 13:00:00', 'TankB', 32.2, 'Celsius', 35.0, 30.0, 0, 'Sensor_201', 2, 'Warehouse_2', 'Carbon Steel', 'Diesel', '2024-10-01', '2024-09-01', 'Rising Slowly', 28.2, 0, 0, 'PLC_2'),
-- 数据记录6
('2024-11-01 13:15:00', 'TankB', 32.5, 'Celsius', 35.0, 30.0, 0, 'Sensor_201', 2, 'Warehouse_2', 'Carbon Steel', 'Diesel', '2024-10-01', '2024-09-01', 'Rising Slowly', 28.3, 0, 0, 'PLC_2'),
-- 数据记录7
('2024-11-01 13:30:00', 'TankC', 26.0, 'Celsius', 28.0, 24.0, 0, 'Sensor_301', 3, 'Warehouse_3', 'Stainless Steel', 'Lubricating Oil', '2024-08-20', '2024-07-15', 'Stable', 23.0, 0, 0, 'PLC_3'),
-- 数据记录8
('2024-11-01 13:45:00', 'TankC', 26.2, 'Celsius', 28.0, 24.0, 0, 'Sensor_301', 3, 'Warehouse_3', 'Stainless Steel', 'Lubricating Oil', '2024-08-20', '2024-07-15', 'Rising Slowly', 23.2, 0, 0, 'PLC_3'),
-- 数据记录9
('2024-11-01 14:00:00', 'TankC', 26.5, 'Celsius', 28.0, 24.0, 0, 'Sensor_301', 3, 'Warehouse_3', 'Stainless Steel', 'Lubricating Oil', '2024-08-20', '2024-07-15', 'Rising Slowly', 23.3, 0, 0, 'PLC_3'),
-- 数据记录10
('2024-11-01 14:15:00', 'TankA', 29.2, 'Celsius', 30.0, 25.0, 0, 'Sensor_101', 1, 'Warehouse_1', 'Steel', 'Crude Oil', '2024-09-15', '2024-08-01', 'Rising Slowly', 25.5, 0, 0, 'PLC_1'),
-- 数据记录11
('2024-11-01 14:30:00', 'TankA', 29.5, 'Celsius', 30.0, 25.0, 0, 'Sensor_101', 1, 'Warehouse_1', 'Steel', 'Crude Oil', '2024-09-15', '2024-08-01', 'Rising Slowly', 25.6, 0, 0, 'PLC_1'),
-- 数据记录12
('2024-11-01 14:45:00', 'TankB', 32.8, 'Celsius', 35.0, 30.0, 0, 'Sensor_201', 2, 'Warehouse_2', 'Carbon Steel', 'Diesel', '2024-10-01', '2024-09-01', 'Rising Slowly', 28.5, 0, 0, 'PLC_2'),
-- 数据记录13
('2024-11-01 15:00:00', 'TankB', 33.0, 'Celsius', 35.0, 30.0, 0, 'Sensor_201', 2, 'Warehouse_2', 'Carbon Steel', 'Diesel', '2024-10-01', '2024-09-01', 'Rising Slowly', 28.6, 0, 0, 'PLC_2'),
-- 数据记录14
('2024-11-01 15:15:00', 'TankC', 26.8, 'Celsius', 28.0, 24.0, 0, 'Sensor_301', 3, 'Warehouse_3', 'Stainless Steel', 'Lubricating Oil', '2024-08-20', '2024-07-15', 'Rising Slowly', 23.5, 0, 0, 'PLC_3'),
-- 数据记录15
('2024-11-01 15:30:00', 'TankC', 27.0, 'Celsius', 28.0, 24.0, 0, 'Sensor_301', 3, 'Warehouse_3', 'Stainless Steel', 'Lubricating Oil', '2024-08-20', '2024-07-15', 'Rising Slowly', 23.6, 0, 0, 'PLC_3'),
-- 数据记录16
('2024-11-01 15:45:00', 'TankA', 29.8, 'Celsius', 30.0, 25.0, 0, 'Sensor_101', 1, 'Warehouse_1', 'Steel', 'Crude Oil', '2024-09-15', '2024-08-01', 'Rising Slowly', 25.8, 0, 0, 'PLC_1'),
-- 数据记录17
('2024-11-01 16:00:00', 'TankA', 30.0, 'Celsius', 30.0, 25.0, 1, 'Sensor_101', 1, 'Warehouse_1', 'Steel', 'Crude Oil', '2024-09-15', '2024-08-01', 'Near Max', 26.0, 0, 0, 'PLC_1'),
-- 数据记录18
('2024-11-01 16:15:00', 'TankB', 33.2, 'Celsius', 35.0, 30.0, 0, 'Sensor_201', 2, 'Warehouse_2', 'Carbon Steel', 'Diesel', '2024-10-01', '2024-09-01', 'Rising Slowly', 28.8, 0, 0, 'PLC_2'),
-- 数据记录19
('2024-11-01 16:30:00', 'TankB', 33.5, 'Celsius', 35.0, 30.0, 0, 'Sensor_201', 2, 'Warehouse_2', 'Carbon Steel', 'Diesel', '2024-10-01', '2024-09-01', 'Rising Slowly', 29.0, 0, 0, 'PLC_2'),
-- 数据记录20
('2024-11-01 16:45:00', 'TankC', 27.2, 'Celsius', 28.0, 24.0, 0, 'Sensor_301', 3, 'Warehouse_3', 'Stainless Steel', 'Lubricating Oil', '2024-08-20', '2024-07-15', 'Rising Slowly', 23.8, 0, 0, 'PLC_3'),
-- 数据记录21
('2024-11-01 17:00:00', 'TankC', 27.5, 'Celsius', 28.0, 24.0, 0, 'Sensor_301', 3, 'Warehouse_3', 'Stainless Steel', 'Lubricating Oil', '2024-08-20', '2024-07-15', 'Rising Slowly', 24.0, 0, 0, 'PLC_3'),
-- 数据记录22
('2024-11-01 17:15:00', 'TankA', 30.2, 'Celsius', 30.0, 25.0, 1, 'Sensor_101', 1, 'Warehouse_1', 'Steel', 'Crude Oil', '2024-09-15', '2024-08-01', 'Above Max', 26.2, 0, 0, 'PLC_1'),
-- 数据记录23
('2024-11-01 17:30:00', 'TankA', 30.5, 'Celsius', 30.0, 25.0, 1, 'Sensor_101', 1, 'Warehouse_1', 'Steel', 'Crude Oil', '2024-09-15', '2024-08-01', 'Above Max', 26.3, 0, 0, 'PLC_1'),
-- 数据记录24
('2024-11-01 17:45:00', 'TankB', 33.8, 'Celsius', 35.0, 30.0, 0, 'Sensor_201', 2, 'Warehouse_2', 'Carbon Steel', 'Diesel', '2024-10-01', '2024-09-01', 'Rising Slowly', 29.2, 0, 0, 'PLC_2'),
-- 数据记录25
('2024-11-01 18:00:00', 'TankB', 34.0, 'Celsius', 35.0, 30.0, 0, 'Sensor_201', 2, 'Warehouse_2', 'Carbon Steel', 'Diesel', '2024-10-01', '2024-09-01', 'Near Max', 29.3, 0, 0, 'PLC_2'),
-- 数据记录26
('2024-11-01 18:15:00', 'TankC', 27.8, 'Celsius', 28.0, 24.0, 0, 'Sensor_301', 3, 'Warehouse_3', 'Stainless Steel', 'Lubricating Oil', '2024-08-20', '2024-07-15', 'Rising Slowly', 24.2, 0, 0, 'PLC_3'),
-- 数据记录27
('2024-11-01 18:30:00', 'TankC', 28.0, 'Celsius', 28.0, 24.0, 1, 'Sensor_301', 3, 'Warehouse_3', 'Stainless Steel', 'Lubricating Oil', '2024-08-20', '2024-07-15', 'At Max', 24.3, 0, 0, 'PLC_3'),
-- 数据记录28
('2024-11-01 18:45:00', 'TankA', 30.8, 'Celsius', 30.0, 25.0, 1, 'Sensor_101', 1, 'Warehouse_1', 'Steel', 'Crude Oil', '2024-09-15', '2024-08-01', 'Above Max', 26.5, 0, 0, 'PLC_1'),
-- 数据记录29
('2024-11-01 19:00:00', 'TankA', 31.0, 'Celsius', 30.0, 25.0, 1, 'Sensor_101', 1, 'Warehouse_1', 'Steel', 'Crude Oil', '2024-09-15', '2024-08-01', 'Above Max', 26.6, 0, 0, 'PLC_1'),
-- 数据记录30
('2024-11-01 19:15:00', 'TankB', 34.2, 'Celsius', 35.0, 30.0, 0, 'Sensor